<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html>

<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>登录-股市日记</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="登录页面">
	
	<jsp:include page="/core/tool/resources.jsp"></jsp:include>

  </head>

<body>
	<div class="easyui-panel" title="用户注册"
		style="width:500px;padding:10px 60px 20px 60px">
		<form id="form1" name="form1" class="easyui-form" method="post"
			data-options="novalidate:true,ajax:false">
			<table cellpadding="5">
				<tr>
					<td>用户名：</td>
					<td><input name="userName" class="easyui-textbox"
						required="true" style="width:100%;height:40px;padding:12px"
						data-options="prompt:'Username',iconCls:'icon-man',iconWidth:38"></td>
				</tr>
				<tr>
					<td>姓名：</td>
					<td><input name="userFullname" class="easyui-textbox"
						required="true" style="width:100%;height:40px;padding:12px"
						data-options="iconWidth:38"></td>
				</tr>
				<tr>
					<td>密码：</td>
					<td><input name="userPwd" class="easyui-textbox"
						type="password" required="true"
						style="width:100%;height:40px;padding:12px"
						data-options="prompt:'Password',iconCls:'icon-lock',iconWidth:38"></td>
				</tr>
				<tr>
					<td>密码确认：</td>
					<td><input name="userPwd2" class="easyui-textbox"
						type="password" required="true"
						style="width:100%;height:40px;padding:12px"
						data-options="prompt:'Password',iconCls:'icon-lock',iconWidth:38"></td>
				</tr>
				<tr>
					<td>角色选择</td>
					<td><select  name="role" class="easyui-combobox"
							required="true" style="width:100%;height:40px;padding:12px"
							data-options="iconWidth:38">
							<option>老师</option>
							<option>学生</option>
						</select >
					</td>
				</tr>
				
				</tr>
				<td colspan="2"><a class="easyui-linkbutton" onClick="doRegister()" style="padding:5px 0px;width:45%;">
						<span style="font-size:14px;">注册</span>
				</a>
				<a data-options="iconCls:'icon-add'" style="padding:5px 0px;width:45%"
					href="${pageContext.request.contextPath}/base/login/login.jsp">
						<span style="font-size:14px;">登录</span>
				</a></td>
				</tr>
			</table>
		</form>
	</div>
</body>
</html>

<script type="text/javascript">

	function doRegister() {
		var a=$("#form1").form('enableValidation').form('validate');
		if(a){
			document.form1.action="${pageContext.request.contextPath}/base/userlogin/register.do";
			document.form1.submit();
		}
	}
</script>
